package com.example.DataSource.controller;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.example.DataSource.entity.consultantEvaluate;
import com.example.DataSource.serviceImpl.CEServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/ljkDemo/CE") // CE: 用户评价管理
public class CEController {

    @Autowired
    private CEServiceImpl ceService;

    @GetMapping("/deleteInfo")
    public void delete(String id){
        ceService.removeById(id);
    }

    @GetMapping("/getAll")
    public IPage<consultantEvaluate> getAll(int current, int size){
        Page<consultantEvaluate> page = new Page<>(current, size);
        return ceService.getCEPage(page);
    }

    @GetMapping("/search")
    public IPage<consultantEvaluate> search(int current, int size,String searchInfo){
        Page<consultantEvaluate> page = new Page<>(current, size);
        return ceService.getCEPageSearch(page,searchInfo);
    }
}
